import { configureStore } from '@reduxjs/toolkit';

import authSlice from './modules/auth';

const store = configureStore({
  reducer: {
    auth: authSlice.reducer
  }
});

// 用于做类型推导
const state = {
  auth: authSlice.getInitialState()
};

// 输出state类型
export type State = typeof state;

// 输出事件集
export const actions = {
  auth: {
    ...authSlice.actions
  }
};

// 输出store
export default store;
